package app.core;

import java.util.Scanner;

/**
 * 测试客户端连接服务器
 * @author Guo.Yang
 * @version 1.0
 * @date 2023/1/15 17:53
 */
public class Test {
    public static void main(String[] args) {
        Client client = new Client("127.0.0.1", 13668);
        client.accept((data)->{
            System.out.println("响应:"+ data.getMessage());
        });
        while (true){
            Scanner scanner = new Scanner(System.in);
            String line = scanner.nextLine();
            if (line.startsWith("re")){
                String[] split = line.split(":");
                client.setName(split[1]);
                continue;
            }
            client.sendAll(line);
        }
    }
}
